<script type="text/javascript" src="<?php echo "libs/json/json2.js"; ?>"></script>

<style type="text/css">
.menu {
  cursor: pointer;
  border-bottom: 0;
  line-height: 49px;
  padding-right: 20px;
}
.menu a {
  color: #fff;
  text-decoration: none;
  
}
.menu:hover {
  background-color: #fff;
  border-bottom: 1px solid #ff0000;
}
.menu:hover a {
  color: #000;
}
.hi {
  background-color: #fff !important;
  border-bottom: 0;
}
.hi a {
  color: #825050 !important;
}
ul li {
  float: left;
}
li {
  list-style-image: none;
  list-style-type: none;
}
.m0h span {
  background-position: -76px -113px;
}
.m0 span {
  background-position: -76px 0;
}
.m0:hover span {
  background-position: -76px -113px;
  transition: all 0.25s linear 0.01s;
  -moz-transition: all 0.25s linear 0.01s; /* Firefox 4 */
  -webkit-transition: all 0.25s linear 0.01s; /* Safari and Chrome */
  -o-transition: all 0.25s linear 0.01s; /* Opera */
}
.m1h span {
  background-position: -76px -664px;
}
.m1 span {
  background-position: -76px -603px;
}
.m1:hover span {
  background-position: -76px -664px;
  transition: all 0.25s linear 0.01s;
  -moz-transition: all 0.25s linear 0.01s; /* Firefox 4 */
  -webkit-transition: all 0.25s linear 0.01s; /* Safari and Chrome */
  -o-transition: all 0.25s linear 0.01s; /* Opera */
}
.m2h span {
  background-position: -76px -634px;
}
.m2 span {
  background-position: -76px -573px;
}
.m2:hover span {
  background-position: -76px -634px;
  transition: all 0.25s linear 0.01s;
  -moz-transition: all 0.25s linear 0.01s; /* Firefox 4 */
  -webkit-transition: all 0.25s linear 0.01s; /* Safari and Chrome */
  -o-transition: all 0.25s linear 0.01s; /* Opera */
}
.m3h span {
  background-position: -76px -143px;
}
.m3 span {
  background-position: -76px -30px;
}
.m3:hover span {
  background-position: -76px -143px;
  transition: all 0.25s linear 0.01s;
  -moz-transition: all 0.25s linear 0.01s; /* Firefox 4 */
  -webkit-transition: all 0.25s linear 0.01s; /* Safari and Chrome */
  -o-transition: all 0.25s linear 0.01s; /* Opera */
}
.m4h span {
  background-position: -76px -734px;
}
.m4 span {
  background-position: -76px -764px;
}
.m4:hover span {
  background-position: -76px -734px;
  transition: all 0.25s linear 0.01s;
  -moz-transition: all 0.25s linear 0.01s; /* Firefox 4 */
  -webkit-transition: all 0.25s linear 0.01s; /* Safari and Chrome */
  -o-transition: all 0.25s linear 0.01s; /* Opera */
}
.m5h span {
  background-position: -76px -170px;
}
.m5 span {
  background-position: -76px -57px;
}
.m5:hover span {
  background-position: -76px -170px;
  transition: all 0.25s linear 0.01s;
  -moz-transition: all 0.25s linear 0.01s; /* Firefox 4 */
  -webkit-transition: all 0.25s linear 0.01s; /* Safari and Chrome */
  -o-transition: all 0.25s linear 0.01s; /* Opera */
}
.menu span {
  background-image: url(exts/uis/<?php echo $path; ?>/assets/imgs/tingicos.png);
  background-repeat: no-repeat;
  float: left;
  height: 30px;
  margin-left: 14px !important;
  margin-top: 12px;
  margin-right: 4px;
  width: 39px;
  display: block;
}
.ctrl {
  cursor: pointer;
  border-bottom: 0;
  line-height: 49px;
  padding: 0 5px;
  color: #ddd;
}
.ctrl a {
  color: #ddd;
  
}
</style>

<?php 
$id = MiscUtils::getParam('i', $pages[0]->id);
$mRoot = new stdClass();
$mRoot->id = 0;
$mRoot->name = 'ROOT';
$mRoot->link = '';
_createMenuRoot($pages, $mRoot);
?>

<ul style="padding: 0;">
<?php
  foreach ($mRoot->c as $idx => &$m) {
    echo "<li class=\"menu m$idx" . (($page_id == $m->id) ? 'h hi' : '') . "\"><a href=\"?i=$m->id\"><span></span>$m->name</a></li>";
  }
?>
<?php if (isset($_SESSION['index' . USER]) && $_SESSION['index' . USER]->id) { ?>
<li style="width: 610px;">&nbsp;</li>
<li class="ctrl"><a href="?i=<?php echo CLIENT_ACCOUNT_ID; ?>">我的账号</a></li>
<li class="ctrl">|</li>
<li class="ctrl"><a href="?i=<?php echo $page_id; ?>&logout=1">注销</a></li>
<?php } else { ?>
<li style="width: 610px;">&nbsp;</li>
<li class="ctrl"><a href="?i=<?php echo CLIENT_LOGIN_ID; ?>">登录</a></li>
<li class="ctrl">|</li>
<li class="ctrl"><a href="?i=<?php echo CLIENT_LOGIN_ID; ?>&init=register">注册</a></li>
<?php } ?>
</ul>

